Skip to content

zstandard: build wheels for riscv64#161

Open
gounthar wants to merge 3 commits into
mainfrom
zstandard-riscv64
Open

zstandard: build wheels for riscv64#161
gounthar wants to merge 3 commits into
mainfrom
zstandard-riscv64

Conversation

@gounthar

@gounthar gounthar commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Adds a riscv64 wheel build for zstandard, modeled on build-numpy.yml. First package I'm adding since converging my own wheel set into RISE, so tell me if I've missed a house convention.

Why zstandard. No riscv64 wheels on PyPI (0.25.0 ships every arch except riscv64), and it's a common dependency, so riscv64 users build it from source today. Upstream's release matrix covers aarch64/x86_64/ppc64le/s390x but not riscv64.

What's here.

  • .github/workflows/build-zstandard.yml: cibuildwheel on ubuntu-24.04-riscv, same shape as numpy (build then publish, publish gated on main).
  • zstandard added to ci_scripts/packages.txt.

Porting notes.

  • CIBW_BUILD: <py>-manylinux_riscv64 (manylinux only, musl skipped by construction).
  • The 0.25.0 tag pins enable = ["cpython-freethreading", "cpython-prerelease"] and targets cibuildwheel 3.x. The pinned cibuildwheel 4.1.0 removed the cpython-freethreading group (freethreaded builds are default in 4.x) and errors on it at config-parse, so a small pre-build step strips it. cp314t still builds. Upstream HEAD already dropped it, so this only applies to this tag.
  • zstandard tags aren't v-prefixed (unlike numpy), so the checkout ref is the bare version.
  • Build frontend: upstream pins build[uv]. The current manylinux_2_39_riscv64 image ships uv, so I'm letting build[uv] run rather than forcing plain build, to confirm it works on riscv64 (this is the open question from the dev-guide review on python-wheels: add a development guide #159).

Still watching. ZSTD_WARNINGS_AS_ERRORS=1 is set in upstream's cibuildwheel env, so the strict build could trip on a riscv64-specific warning (my local build used plain pip wheel, which doesn't set it). Test extras (test-groups = ["dev"], xdist) are the other likely hurdle.

Kept it minimal on purpose (no ccache, unlike numpy) since the build is quick.

Trigger: zstandard:0.25.0

Refs #163

gounthar added 2 commits July 14, 2026 18:10
Add a riscv64 wheel build for zstandard, modeled on build-numpy.yml, and
register the package in ci_scripts/packages.txt.

zstandard ships no riscv64 wheels on PyPI (0.25.0 covers every arch except
riscv64) and is a common dependency, so riscv64 users build it from source
today.

riscv64 specifics:
- CIBW_BUILD restricted to <py>-manylinux_riscv64 (musl skipped by
  construction).
- CIBW_BUILD_FRONTEND forced to `build`: upstream pins `build[uv]` in
  pyproject.toml, which fails on riscv64 because uv is absent from the
  manylinux_riscv64 image.
- Checkout ref is the bare version, since zstandard tags are not v-prefixed.

Signed-off-by: Bruno Verachten <[email protected]>
The 0.25.0 tag pins enable = ["cpython-freethreading", "cpython-prerelease"]
and targets cibuildwheel 3.x. RISE pins cibuildwheel 4.1.0, which removed the
cpython-freethreading group (freethreaded builds are default now) and errors on
it at config-parse. Strip that group so 4.1.0 can read the config.

Also drop the CIBW_BUILD_FRONTEND override: the manylinux_2_39_riscv64 image
now ships uv, so let upstream's build[uv] frontend run and confirm it works on
riscv64 rather than forcing the plain build frontend.

Signed-off-by: Bruno Verachten <[email protected]>
@gounthar gounthar marked this pull request as ready for review July 14, 2026 16:41

@threexc threexc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than a handful of review comments, I think that this looks OK. I'd like to let @justeph also have a look so he can see what we're up to.

Comment thread .github/workflows/build-zstandard.yml Outdated
python: ["cp312", "cp313", "cp314", "cp314t"]

steps:
- name: Checkout python-wheels

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This checkout isn't used, feel free to remove it. It's a pattern I had placed in my numpy workflow and forgot to remove it after I got it working.

Comment thread .github/workflows/build-zstandard.yml Outdated
env:
CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64
# Upstream pins `build-frontend = "build[uv]"` in pyproject.toml, which
# fails on riscv64: uv is not present in the manylinux_riscv64 image, so

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this leftover from before our check for uv in the manylinux image?

Comment thread .github/workflows/build-zstandard.yml Outdated
# version. Manual trigger is the only entry point, so checking the ref is
# enough to gate uploads.
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04-riscv

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was also a mistake on my end - we don't need to unnecessarily load up the RISC-V Runners here. Can you change it to ubuntu-latest?

Comment thread .github/workflows/build-zstandard.yml Outdated
merge-multiple: true

- name: Publish to GitLab PyPI registry
uses: ./python-wheels-repo/actions/publish-to-gitlab

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Ludovic suggested, you can instead use:

uses: riseproject-dev/python-wheels/actions/publish-to-gitlab@main

in which case the Checkout python-wheels step above can also be removed.

Comment thread .github/workflows/build-zstandard.yml Outdated
strategy:
fail-fast: false
matrix:
python: ["cp312", "cp313", "cp314", "cp314t"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, have you tried the 3.11 build before? I've updated the draft dev guide to suggest that our full build matrix should be the following, until 3.15 is released:

["cp311", "cp312", "cp313", "cp314", "cp314t"]

@threexc

threexc commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

One thing I forgot to mention completely in the dev guide (maybe this is best placed in a separate doc section and referenced): We needed an open issue for zstandard. I've created: #163

In this case, since you've already submitted a PR upstream and are now waiting for feedback, the label waiting for maintainer has been added there. Even once we merge this, the issue should remain open (and referenced by subsequent commits where needed) so we can track the relative amount of churn each package goes through while waiting for upstream.

…ish, cp311

- Remove the leftover Checkout python-wheels step in build_wheels (unused).
- Publish job runs on ubuntu-latest (no need for a riscv64 runner).
- Use riseproject-dev/python-wheels/actions/publish-to-gitlab@main and drop the
  publish job's checkout.
- Add cp311 to the build matrix per the updated dev-guide matrix.

Signed-off-by: Bruno Verachten <[email protected]>
@gounthar

Copy link
Copy Markdown
Collaborator Author

Thanks @threexc, all applied:

  • Dropped the unused Checkout python-wheels step in build_wheels.
  • The CIBW_BUILD_FRONTEND override is already gone. I removed it a couple of pushes back once we confirmed build[uv] works in the current manylinux image, so that thread predates the current diff.
  • Publish job is now ubuntu-latest.
  • Switched to riseproject-dev/python-wheels/actions/publish-to-gitlab@main and dropped the publish job's checkout.
  • Matrix is now ["cp311", "cp312", "cp313", "cp314", "cp314t"]. I hadn't built 3.11 specifically (my releases were cp312+), but it's the same C and the PR build will exercise it.

Refs #163. Happy to wait for @justeph.

@justeph

justeph commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

@gounthar you are the first one opening such issue on the repo, thank you for that!
I have one question / concern : IIUC the build-zstandard.yaml should be based on the upstream workflow, modified to add riscv64 support, with additional jobs for publishing. Looks like you based build-zstandard.yaml on build-numpy.yaml. Also the PR opened on upstream is based on QEMU and not on riscv64 native builder, so maybe you should rework your upstream PR, to use native builder, and point to this PR (which is the main purpose of this repo: building, testing, deploying riscv64 wheel for users, but also give confidence to maintainer that it can be integrated in their workflow easily).

What do you think? Maybe @threexc have a different opinion on that?

@threexc

threexc commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

@gounthar you are the first one opening such issue on the repo, thank you for that! I have one question / concern : IIUC the build-zstandard.yaml should be based on the upstream workflow, modified to add riscv64 support, with additional jobs for publishing. Looks like you based build-zstandard.yaml on build-numpy.yaml. Also the PR opened on upstream is based on QEMU and not on riscv64 native builder, so maybe you should rework your upstream PR, to use native builder, and point to this PR (which is the main purpose of this repo: building, testing, deploying riscv64 wheel for users, but also give confidence to maintainer that it can be integrated in their workflow easily).

What do you think? Maybe @threexc have a different opinion on that?

We do generally want to closely mirror upstream. I think there's maybe a debate to have here about how different/similar our workflows actually can be, given that we need to substitute a push action and tweak some other things too.

It would be good to update the upstream PR with the native builder and point here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants